/**
 * 
 */
package com.jrh.web.member;

import javax.validation.constraints.Size;

import com.jrh.domain.entity.User;

/**
 * 类UserForm.java的实现描述：TODO 类实现描述
 * 
 * @author shengli.caosl 2012-2-27 下午10:17:02
 */
public class UserForm {

    private Long   userProfileId;

    @Size(max = 20, min = 6, message = "用户名长度必须在6-20个字符间")
    private String loginId;

    @Size(max = 20, min = 6, message = "密码长度必须在6-20个字符间")
    private String password;

    @Size(max = 20, min = 6, message = "密码长度必须在6-20个字符间")
    private String verifyPassword;

    // @Pattern(regexp = "([\\w-.]+@[\\w.]+)?", message = "请填写正确邮箱")
    // @Size(max = 64)
    private String email;

    private int    sex;

    // @Size(max = 16, message = "手机号码必须小于16位")
    private String mobile;

    /** 用户昵称 */
    @Size(max = 20, min = 6, message = "昵称长度必须在6-20个字符间")
    private String nickname;

    // @Size(max = 50, min = 2, message = "昵称长度必须在2-50个字符间")
    private String question;

    // @Size(max = 50, min = 2, message = "昵称长度必须在2-50个字符间")
    private String answer;

    private String pcode;

    private User   user = new User();

    public Long getUserProfileId() {
        return userProfileId;
    }

    public void setUserProfileId(Long userProfileId) {
        this.userProfileId = userProfileId;
    }

    /**
     * @return the userName
     */
    public String getLoginId() {
        return loginId;
    }

    /**
     * @param userName the userName to set
     */
    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * @param mobile the mobile to set
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public User getUser() {
        user.setLoginId(loginId);
        user.setPassword(password);
        return user;
    }

    public String getVerifyPassword() {
        return verifyPassword;
    }

    public void setVerifyPassword(String verifyPassword) {
        this.verifyPassword = verifyPassword;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPcode() {
        return pcode;
    }

    public void setPcode(String pcode) {
        this.pcode = pcode;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Override
    public String toString() {
        return "UserForm [loginId=" + loginId + ", password=" + password + ", verifyPassword=" + verifyPassword
               + ", email=" + email + ", mobile=" + mobile + ", nickname=" + nickname + ", user=" + user
               + ", question=" + question + ", answer=" + answer + "]";
    }

}
